import type { RouteRecordRaw } from 'vue-router';

// layout 布局
const Layout = () => import('@/layout/index.vue');
// 防抖
const Debounce = () => import('@/views/fun/debounce/index.vue');
// 节流
const Throttle = () => import('@/views/fun/throttle/index.vue');
// 复制
const Copy = () => import('@/views/fun/copy/index.vue');
// 文件上传
const Upload = () => import('@/views/fun/upload/index.vue');

const routes: RouteRecordRaw = {
	path: '/fun',
	name: 'funLayout',
	component: Layout,
	meta: {
		title: 'router.fun',
		icon: 'gongneng',
		index: '/fun',
	},
	children: [
		{
			path: '/fun/debounce',
			name: 'funDebounceRouter',
			component: Debounce,
			meta: {
				title: 'router.debounce',
				icon: 'anniu',
				index: '/fun/debounce',
			},
		},
		{
			path: '/fun/throttle',
			name: 'funThrottleRouter',
			component: Throttle,
			meta: {
				title: 'router.throttle',
				icon: 'anniu',
				index: '/fun/throttle',
			},
		},
		{
			path: '/fun/copy',
			name: 'funCopyRouter',
			component: Copy,
			meta: {
				title: 'router.copy',
				icon: 'anniu',
				index: '/fun/copy',
			},
		},
		{
			path: '/fun/upload',
			name: 'funUploadRouter',
			component: Upload,
			meta: {
				title: 'router.upload',
				icon: 'dengpao',
				index: '/fun/upload',
			},
		},
	],
};

export default routes;
